package com.colin.app.activity.other;

import com.colin.app.app.BaseModelImpl;
import com.colin.app.bean.DemoBean;
import com.colin.app.bean.ItemBean;
import com.colin.library.other.Url;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Colin on 2017/2/7.
 */

public class OtherModelImpl extends BaseModelImpl implements OtherContract.OtherModel {
    private DemoBean demoBean;

    public OtherModelImpl(DemoBean demoBean) {
        this.demoBean = demoBean;
    }

    @Override
    public String getTitle() {
        String title = "Title";
        if (null != demoBean) {
            title = demoBean.getTitle();
        }
        return title;
    }

    @Override
    public List<ItemBean> getItemBeanList(int page) {
        List<ItemBean> itemBeanList = new ArrayList<>();
        ItemBean itemBean = null;
        for (int i = 0; i < pageSize; i++) {
            itemBean = new ItemBean().setImage(Url.image_url[i])
                    .setImageLarge(Url.image_url[i])
                    .setAuthor_intro("Colin")
                    .setTitle("Colin-->>" + String.valueOf((page - 1) * pageSize + i + 1))
                    .setCatalog("Colin");
            itemBeanList.add(itemBean);
        }
        return itemBeanList;
    }

}
